package com.sunjob.mromessage.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * @author LongJunJiang
 * @create 2022-08-18-20:07
 */

@Configuration
@EnableSwagger2
public class SwaggerConfig {
    @Bean
    public Docket getDocket(){
        return new Docket(DocumentationType.SWAGGER_2)
                .apiInfo(getApi())
                .select()
                .apis(RequestHandlerSelectors.basePackage("com.sunjob.mromessage"))
                .paths(PathSelectors.any())
                .build();
    }

    public ApiInfo getApi(){
        return new ApiInfoBuilder()
                .title("消息中心接口文档")
                .version("1.0")
                .description("")
                .contact(new Contact("龙俊江", "", "3267208453@qq.com"))
                .build();
    }
}
